package com.cl.unipay4j.demo.example;

import com.cl.unipay4j.ali.AliPayFactory;
import com.cl.unipay4j.core.IPayFactory;
import com.cl.unipay4j.core.PayChannel;
import com.cl.unipay4j.wx.WxPayFactory;

/**
 * @ClassName PayFactoryBuilder
 * @Description
 * @Author Small
 * @Date 2019/12/4 19:26
 * @Version 1.0
 **/
public class PayFactory {

    public static IPayFactory getFactory(PayChannel payChannel) {
        IPayFactory payFactory = null;
        switch (payChannel) {
            case WX:
                payFactory = new WxPayFactory();
                break;
            case ALI:
                payFactory = new AliPayFactory();
                break;
            default:
                break;
        }
        return payFactory;
    }
}
